
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
    </head>
    <body>
    
<div class="archive_info">
<h1>HTML <span class="color_h1">&lt;head&gt;</span></h1>
<hr/><div class="tryit_ex">
<img alt="Examples" decoding="async" height="46px" src="/images/tryitimg.gif" width="40"/><h2>查看在线实例</h2>
</div>
<p><a  rel="noopener noreferrer" target="_blank">&lt;title&gt; - 定义了HTML文档的标题</a><br/>
使用 &lt;title&gt; 标签定义HTML文档的标题</p>
<p><a  rel="noopener noreferrer" target="_blank">&lt;base&gt; - 定义了所有链接的URL</a><br/>
使用 &lt;base&gt; 定义页面中所有链接默认的链接目标地址。</p>
<p><a  rel="noopener noreferrer" target="_blank">&lt;meta&gt; - 
提供了HTML文档的meta标记</a><br/>
使用 &lt;meta&gt; 元素来描述HTML文档的描述，关键词，作者，字符集等。</p>
<hr/><h2>HTML &lt;head&gt; 元素</h2>
<p>&lt;head&gt; 元素包含了所有的头部标签元素。在
&lt;head&gt;元素中你可以插入脚本（scripts）, 样式文件（CSS），及各种meta信息。</p>
<p>可以添加在头部区域的元素标签为: &lt;title&gt;, &lt;style&gt;, 
&lt;meta&gt;, &lt;link&gt;,  
&lt;script&gt;, &lt;noscript&gt; 和 &lt;base&gt;。</p>
<hr/><h2> HTML &lt;title&gt; 元素</h2>
<p> &lt;title&gt; 标签定义了不同文档的标题。</p>
<p> &lt;title&gt; 在 HTML/XHTML 文档中是必需的。</p>
<p> &lt;title&gt; 元素:</p>
<ul>
<li>定义了浏览器工具栏的标题</li>
<li>当网页添加到收藏夹时，显示在收藏夹中的标题</li>
<li>显示在搜索引擎结果页面的标题</li>
</ul>
<p>一个简单的 HTML 文档:</p>
<div class="example">
<h2 class="example">实例</h2>
<div class="example_code">
<div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-code">!</span><span class="hl-var">DOCTYPE</span><span class="hl-code"> </span><span class="hl-var">html</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">html</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">meta</span><span class="hl-code"> </span><span class="hl-var">charset</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">utf-8</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">title</span><span class="hl-brackets">&gt;</span><span class="hl-code">文档标题</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">title</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">body</span><span class="hl-brackets">&gt;</span><span class="hl-code">
文档内容......
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">body</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">html</span><span class="hl-brackets">&gt;</span></div>
</div>
</div>
<br/>
<hr/><h2>HTML &lt;base&gt; 元素</h2>
<p>&lt;base&gt; 标签描述了基本的链接地址/链接目标，该标签作为HTML文档中所有的链接标签的默认链接:</p>
<div class="example"><h2 class="example">实例</h2> <div class="example_code"><div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">base</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">http://www.runoob.com/images/</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">target</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">_blank</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span></div></div></div>
<hr/><h2> HTML &lt;link&gt; 元素</h2>
<p> &lt;link&gt; 标签定义了文档与外部资源之间的关系。</p>
<p> &lt;link&gt; 标签通常用于链接到样式表:</p>
<div class="example"><h2 class="example">实例</h2> <div class="example_code"><div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">link</span><span class="hl-code"> </span><span class="hl-var">rel</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">stylesheet</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">type</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">text/css</span><span class="hl-quotes">"</span><span class="hl-code"> </span><span class="hl-var">href</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">mystyle.css</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span></div></div></div>
<br/>
<hr/><h2>HTML &lt;style&gt; 元素</h2>
<p>&lt;style&gt; 标签定义了HTML文档的样式文件引用地址.</p>
<p>在&lt;style&gt; 元素中你也可以直接添加样式来渲染 HTML 文档:</p>
<div class="example"><h2 class="example">实例</h2> <div class="example_code"><div class="hl-main"><span class="hl-brackets">&lt;</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;</span><span class="hl-reserved">style</span><span class="hl-code"> </span><span class="hl-var">type</span><span class="hl-code">=</span><span class="hl-quotes">"</span><span class="hl-string">text/css</span><span class="hl-quotes">"</span><span class="hl-brackets">&gt;</span><span class="hl-code">
body {
    background-color:yellow;
}
p {
    color:blue
}
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">style</span><span class="hl-brackets">&gt;</span><span class="hl-code">
</span><span class="hl-brackets">&lt;/</span><span class="hl-reserved">head</span><span class="hl-brackets">&gt;</span></div></div></div>
<br/>
<hr/><h2>HTML &lt;meta&gt; 元素</h2>
<p>meta标签描述了一些基本的元数据。</p>
<p>&lt;meta&gt; 标签提供了元数据.元数据也不显示在页面上，但会被浏览器解析。</p>
<p>META 元素通常用于指定网页的描述，关键词，文件的最后修改时间，作者，和其他元数据。</p>
<p>元数据可以使用于浏览器（如何显示内容或重新加载页面），搜索引擎（关键词），或其他Web服务。</p>
<p>&lt;meta&gt; 一般放置于 &lt;head&gt; 区域</p>
<h2>&lt;meta&gt; 标签- 使用实例</h2>
<p>为搜索引擎定义关键词:</p>
<pre>
&lt;meta name="keywords" content="HTML, CSS, XML, XHTML, JavaScript"&gt;
</pre>
<p>为网页定义描述内容:</p>
<pre>
&lt;meta name="description" content="免费 Web &amp; 编程 教程"&gt;
</pre>
<p>定义网页作者:</p>
<pre>
&lt;meta name="author" content="Runoob"&gt;
</pre>
<p>每30秒钟刷新当前页面:</p>
<pre>&lt;meta http-equiv="refresh" content="30"&gt;
</pre>
<br/>
<hr/><h2>HTML &lt;script&gt; 元素</h2>
<p>&lt;script&gt;标签用于加载脚本文件，如： JavaScript。</p>
<p>&lt;script&gt; 元素在以后的章节中会详细描述。</p>
<hr/><h2>HTML head 元素</h2>
<table class="reference">
<tbody><tr>
<th align="left" width="20%">标签</th>
<th align="left" width="80%">描述</th>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;head&gt;</a></td>
<td>定义了文档的信息</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;title&gt;</a></td>
<td>定义了文档的标题</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;base&gt;</a></td>
<td>定义了页面链接标签的默认链接地址</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;link&gt;</a></td>
<td>定义了一个文档和外部资源之间的关系</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;meta&gt;</a></td>
<td>定义了HTML文档中的元数据</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;script&gt;</a></td>
<td>定义了客户端的脚本文件</td>
</tr>
<tr>
<td><a  rel="noopener noreferrer" target="_blank">&lt;style&gt;</a></td>
<td>定义了HTML文档的样式文件</td>
</tr>
</tbody></table> <div class="scroll-top"><a >返回顶部</a></div>
</div>

    </body>
    </html>
    